package com.dura.search.controller;

import com.dura.search.service.SearchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.Map;

/**
 * @version 1.0
 * @Author 振鹏
 * @Date 2025/3/22 13:10
 * @注释
 */
@RestController
@Slf4j
public class SmsSearchController {

    @Autowired
    private SearchService searchService;


    @PostMapping("/search/sms/list")
    public Map<String,Object> findSmsByParameters(@RequestBody Map<String,Object> parameters) throws IOException {
        //1、调用搜索模块完成查询,因为ES在查询数据时，会返回总条数
        Map<String,Object> result = searchService.findSmsByParameters(parameters);
        log.info("数据："+result);
        //2、返回数据
        return result;
    }
}
